import React from 'react';

export class Child extends React.Component {
  handleClick = () => {
    // 向父组件要钱
    this.props.giveMoneyXxx(1000);
  };

  render() {
    console.log(this.props);
    return (
      <div style={{ border: '1px solid blue', padding: 24 }}>
        <h2>Child2</h2>
        <button onClick={this.handleClick}>没钱了</button>
      </div>
    );
  }
}
export default Child;
